﻿// <copyright file="ContosoAnalyticsContextMenuProvider.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2009-10-23</date>
// <summary>ContosoAnalyticsContextMenuProvider class definition</summary>

namespace Contoso.WebAnalytics.Design.Editors
{
    using System;
    using System.Windows;
    using Microsoft.Windows.Design.Interaction;

    /// <summary>
    /// Contoso Analytics Context Menu Provider
    /// </summary>
    public class ContosoAnalyticsContextMenuProvider : PrimarySelectionContextMenuProvider
    {
        /// <summary>
        /// Initializes a new instance of the ContosoAnalyticsContextMenuProvider class.
        /// </summary>
        public ContosoAnalyticsContextMenuProvider()
        {
            var showHeatMap = new MenuAction("Show Heat Map");

            showHeatMap.Execute += new EventHandler<MenuActionEventArgs>(this.OnShowHeatMap);

            MenuGroup group = new MenuGroup("ContosoAnalytics", "Contoso Analytics");

            group.HasDropDown = true;
            group.Items.Add(showHeatMap);
 
            this.Items.Add(group);
        }

        /// <summary>
        /// Show the heat map
        /// </summary>
        /// <param name="sender">the menu item</param>
        /// <param name="e">the menu action event arguments</param>
        private void OnShowHeatMap(object sender, MenuActionEventArgs e)
        {
            MessageBox.Show("Heat Map");
        }
    }
}
